﻿using System;
using YJKCodeBase.Geometry;
using YJKCodeBase.TopologySuite;

namespace YJKRevitCode.RevitTopologySuite
{
	public class RevitPolygonRelateOperater
	{
		public bool TryGetPolygonRelate(RevitPolygonDataBean inputOne, RevitPolygonDataBean inputTwo, out TopologyRelateKindEnum relateResult)
		{
			relateResult = TopologyRelateKindEnum.Contains;
			HYPolygon inputPolygonOne = null;
			HYPolygon inputPolygonTwo = null;
			if (!GeometryTransformer.TryMakeHYPolygon(inputOne, out inputPolygonOne) || !GeometryTransformer.TryMakeHYPolygon(inputTwo, out inputPolygonTwo))
			{
				return false;
			}
			HYPolygonRelateOperater hypolygonRelateOperater = new HYPolygonRelateOperater();
			return hypolygonRelateOperater.TryGetGeometryRelate(inputPolygonOne, inputPolygonTwo, out relateResult);
		}
	}
}
